import itertools


def main():
    for elem in itertools.product('ABCD', '123'):
        print(elem)
    for elem in itertools.permutations('ABCDE'):
        print(elem)
    for elem in itertools.combinations('ABCDE', 2):
        print(elem)


if __name__ == '__main__':
    main()
